auto.waitFor();
function addMark() {
    month = "本月"
    id("com.alipay.mobile.bill.list:id/bill_list_view").findOne();
    bound = idEndsWith("month_title").textEndsWith(month).findOne().bounds();
    console.log(bound);
    while (bounds(bound.left, bound.top, bound.right, bound.bottom).textEndsWith(month).findOne(1000)) {
        let selector = textMatches(/^(商户单号XP|扫收钱码付款-给|优易生鲜|BHG-生活超市|聚田源超市|美团)\S*/)
        if (selector.exists()) {
            console.log(selector.findOne().text());
            parent = selector.findOne().parent();
            if (parent.childCount()==5&&parent.child(3).text() != "家庭账本") {
                parent.click();
                text("标签和备注 添加").className("Button").findOne().click();
                text("家庭账本").findOne().parent().parent().click();
                desc("保存").findOne().click();
                text("标签和备注 家庭账本").className("Button").findOne();
                desc("返回").findOne().click();
            } else {
                console.log("小滑动一下");
                swipe(500, 1200, 500, 900, 100);
            }
        } else {
            console.log("大滑动一下");
            swipe(500, 2156, 500, 900, 100);
        }
    }

}

addMark();